From: Richard M. Stallman Date: Fri, 23 Jul 1993 17:24:45 +0000 (+0000) Subject: (x-select-text): Always set the cut buffer, X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~94814 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=14324c4d46d7519a697e3d63df7d83c48ef90673;p=emacs.git (x-select-text): Always set the cut buffer, but sometimes set it to nothing. Don't put large strings in clipboard. --- diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 98889b96046..f853788075a 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -491,8 +491,10 @@ This returns ARGS with the arguments that have been processed removed." ;;; from x-cut-buffer-or-selection-value. (defvar x-last-selected-text nil) +;;; It is said that overlarge strings are slow to put into the cut buffer, +;;; and would crash the clipboard. (defvar x-cut-buffer-max 20000 - "Max number of characters to put in the cut buffer.") + "Max number of characters to put in the cut buffer or clipboard.") ;;; Make TEXT, a string, the primary and clipboard X selections. ;;; If you are running xclipboard, this means you can effectively @@ -503,8 +505,10 @@ This returns ARGS with the arguments that have been processed removed." ;; Don't send the cut buffer too much text. ;; It becomes slow, and if really big it causes errors. (if (< (length text) x-cut-buffer-max) - (x-set-cut-buffer text push)) - (x-set-selection 'CLIPBOARD text) + (progn + (x-set-cut-buffer text push) + (x-set-selection 'CLIPBOARD text)) + (x-set-cut-buffer "" push)) (x-set-selection 'PRIMARY text) (setq x-last-selected-text text))